import { Card, message } from 'antd';
import ProForm, {
  ProFormDateRangePicker,
  ProFormDependency,
  ProFormDigit,
  ProFormRadio,
  ProFormSelect,
  ProFormText,
  ProFormTextArea,
} from '@ant-design/pro-form';
import { useRequest } from 'umi';
import { PageContainer } from '@ant-design/pro-layout';
// import { fakeSubmitForm } from './service';
import styles from './style.less';

const BasicForm3 = () => {
  // const { run } = useRequest(fakeSubmitForm, {
  //   manual: true,
  //   onSuccess: () => {
  //     message.success('提交成功');
  //   },
  // });

  const onFinish = async (values) => {
    // run(values);
  };

  return (
    <PageContainer content="">
      <Card bordered={false}>
        <ProForm
          hideRequiredMark
          style={{
            marginTop: 8,
          }}
          name="basic"
          layout="vertical"
          initialValues={{
            public: '1',
          }}
          onFinish={onFinish}
        >
          <ProFormText
            width="md"
            label="序号"
            name="title"
            rules={[
              {
                required: true,
                message: '请输入',
              },
            ]}
            placeholder="请输入"
          />
          <ProFormSelect
            options={[
              {
                value: "1",
                label: "一年级",
              },
              {
                value: "2",
                label: "二年级",
              },
            ]}
            width="md"
            name="grade"
            label={`年级`}
          />
          <ProFormSelect
            options={[
              {
                value: "1",
                label: "陈老师",
              },
            ]}
            width="md"
            name="teacher"
            label={`教师`}
          />
          {/* <ProFormDateRangePicker
            label="起止日期"
            width="md"
            name="date"
            rules={[
              {
                required: true,
                message: '请选择起止日期',
              },
            ]}
            placeholder={['开始日期', '结束日期']}
          /> */}
        </ProForm>
      </Card>
    </PageContainer>
  );
};

export default BasicForm3;
